<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'update.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
   <center><h1>修改图书</h1></center>
    <form action="http://localhost:8080//BookManager/book/update1" method="post">
    	<c:forEach var="item" items="${bookList }">
    	<table align="center">
    		<tr>
    			<td>图书编号:</td>
    			<td><input type="text" name="bookCode" value="${item.bookCode}"/> </td>
    		</tr>
    		<tr>
    			<td>图书名称:</td>
    			<td><input type="text" name="bookName" value="${item.bookName}"/> </td>
    		</tr>
    		 <tr>
    			<td>图书类型:</td>
    			<td><select name="bookType" >
    			<option value="1" 
    			<c:if test="${books.bookType==1}"> selected="selected"</c:if>>技术</option>
    			<option value="2"
    			<c:if test="${books.bookType==2}"> selected="selected"</c:if>>文学</option>
    			<option value="3"
    			<c:if test="${books.bookType==3}"> selected="selected"</c:if>>小说</option>
    			<option value="4"
    			<c:if test="${books.bookType==4}"> selected="selected"</c:if>>杂记</option>
    			<option value="5"
    			<c:if test="${books.bookType==5}"> selected="selected"</c:if>>历史</option>
    			
    			</select> </td>
    		</tr>
    		<tr>
    			<td>图书作者:</td>
    			<td><input type="text" name="bookAuthor" value="${item.bookAuthor}" /> </td>
    		</tr>
    		<tr>
    			<td>出版社:</td>
    			<td><input type="text" name="publishPress" value="${item.publishPress}" /> </td>
    		</tr>
    		<tr>
    			<td>出版日期:</td>
    			<td><input type="text" name="ublishDate"  value="${item.ublishDate}"/> </td>
    		</tr>
    		  <tr>
    		<td >是否借阅：</td>
    		<td >
    		<select name="borrowed" >
			  <option value ="1"
			  <c:if test="${books.borrowed==1}">selected="selected"</c:if>>已借阅</option>
			  <option  value ="0"
			  <c:if test="${books.borrowed==0}">selected="selected"</c:if>>未借阅</option>
			</select>
				</td>
    		<tr>  
    			<td>经办人:</td>
    			<td><input type="text" name="createdBy" value="${item.createdBy}" /> </td>
    		</tr>
    		<tr>
    			<td>创办时间:</td>
    			<td><input type="text" name="creationTime" value="${item.creationTime}"/> </td>
    		</tr>
    		<tr>
    			<td>修改时间:</td>
    			<td><input type="text" name="lastUpdatetime" value="<c:if test="${item.lastUpdatetime!=null}">${item.lastUpdatetime}</c:if><c:if test="${item.lastUpdatetime==null}">null</c:if>" /> </td>
    		</tr>
    		<tr>
    			<td><input type="hidden" name="bookId" value="${item.bookId }" /></td>
    		</tr>
    		<tr>
    			<td><input type="submit" value="提交"/></td>
    			<td><a href="book/all">返回</a></td>
    		</tr>
    	</table>
    	</c:forEach>
    	</form>
  </body>
</html>
